<center><div style='width:480;border:solid 1px black'>
<table align=center cellpadding="0" background="images/Bkgrd.jpg2" bgcolor="#f0f0FF" cellspacing="0" style="border:outset 1px">
	<tr>
		<td colspan=4 bgcolor="#FFFFFF">
		<table width=100%>
		   <tr>
			  <td>
				 <font color="#000006"  size=3 face="Verdana, Arial, Helvetica, sans-serif">
				 &nbsp;<b>P</b>HP <strong>I</strong>mage <strong>M</strong>anagement <strong>P</strong>rogram 
				 </font>
			  </td>
			  <td align="right">
				 <img src="images/logo.jpeg"><br>
				 The<b>PIMP</b>
			  </td>
		   </tr>
		</table>
		
		</td>
	</tr>
	<tr> 
	<td bgcolor="#999999"><img src="<?=$href?>?i=px" width="240" height=1></td>
	<td bgcolor="#999999"><img src="<?=$href?>?i=px" width="1" height=1></td>
	<td bgcolor="#999999"><img src="<?=$href?>?i=px" width="1" height=1></td>
	<td bgcolor="#999999"><img src="<?=$href?>?i=px" width="240" height=1></td>
	</tr> 
	<tr>  
	<td colspan=4 bgcolor="#FFFFFF"><img src="<?=$href?>?i=px" width="1" height=1></td>
	</tr> 
	<tr> 
	<td valign="top" style="padding:4px">
	<font size=2 face="Verdana, Arial, Helvetica, sans-serif"><b>Open a Recent File</b></font><br> <br> 
	<table>
	<?
	
	 $arrconfig  = file_to_array($editconfig);
	 if (count($arrconfig)>0) {
		 parse_str($arrconfig[0]);
		 for ($k=1;$k<count($arrconfig);$k++) {
			 parse_str($arrconfig[$k]); 
			$active = $file==$selected?"true":"false";?> 
			<tr>
			   <td align="center">
				  <a href="index.php"><img border="1" height="24" src="thumbnail.php?i=<?=$file?>&h=24"></a>
			   </td>
			   <td valign="top">
				   <a href="<?=$href?>?r=on&e=e&efile=<?=$name?>" style="color:#0000FF "><u><?=strlen($name)>30?"...".substr($name,strlen($name)-30):$name?></u></a><br>
				   <?=str_replace(","," x ",$size)?>
			   </td>
			</tr><?  
			if ($k>5) {
			   ?>
			   <tr>
				  <td colspan="2" align="right">
					  <a href="fmgr.php?f=<?=$editconfig?>">more...</a>
				  </td>
			   </tr>
			   <?
			   break;
			}
		 }
	 } else { ?> 
	   <tr>
		  <td colspan="2">
			  No recent files
		  </td>
	   </tr> <?  
	 } ?>
	
	
	</table>
	</td>
	<td bgcolor="#999999"><img src="<?=$href?>?i=px" width="1" height=320></td>
	<td bgcolor="#FFFFFF"><img src="<?=$href?>?i=px" width="1" height=320></td>
	<td valign="top" style="padding:4px">
	<font size=2 face="Verdana, Arial, Helvetica, sans-serif"><b>Create a New File</b></font>
	<form method="post" action="thumbnail.php">
	<table width="100%" style="border:solid 1px gray" bgcolor="#FFFFFF">
		<tr>
		   <td>Name:</td>
		   <td><input type=text size=20 value="NewDocument" name=ndn></td>
		</tr>
		<tr>
		   <td>Width:</td>
		   <td><input type=text size=3 value="400" name=ndw>
		   &nbsp;Height:
		   <input type=text size=3 value="300" name=ndh>
		   </td>
		</tr>
		<tr>
		   <td valign="top" colspan="2">Background: <br>
		   <input type=radio value='FFFFFF' id=cwhite name=ndc>White<br>
		   <input type=radio value='X' checked id=ctrans name=ndc>Transparent<br>
		   <input type=radio value='FF33FF' id=ccustom name=ndc>Custom<br>
		   <div style="background-color:#FF33FF;width:16;height:16;margin-left:10px" id="colortool" onclick='showColorGrid ()'><img src="images/tool_color.gif"></div>
		   </td>
		</tr>
		   <tr>
			  <td colspan="2" align="right">
				 <input type=submit value="Create Image"><br>
				 <input type=hidden size=3 value="<?= $dirname ?>" name=ndd>
				 <input type=hidden size=3 value="<?= $path ?>" name=ndp>
			  </td>
		   </tr>
	</table>
	</form>
	
	<br>  
	<font size=2 face="Verdana, Arial, Helvetica, sans-serif"><b>Upload a File to Edit</b></font>
	<form method="post" action="<?=$href?>" enctype="multipart/form-data">
	
	
	<input size="15" type="file" name="uploadfile"> 
	 <input type="hidden" name="MAX_FILE_SIZE" value="151200">
	<input type=submit value="Upload">
	 
	</form>
	</td>
	</tr> 
	<tr>  
	<td colspan=4 bgcolor="#CCCCCC"><img src="<?=$href?>?i=px" width="1" height=1></td>
	</tr> 
	 <tr>
	   <td colspan="4" bgcolor="white" style="padding:4px">
	   <a href="<?= $href ?>?e=b">Click <u style="color:blue">here</u> to Browse the server for files</a>.
	   </td>
	 </tr>
	<tr>  
	<td colspan=4 bgcolor="#CCCCCC"><img src="<?=$href?>?i=px" width="1" height=1></td>
	</tr> 
	<tr>  
	<td colspan=4 bgcolor="#FFFFFF"><img src="<?=$href?>?i=px" width="1" height=1></td>
	</tr> 
	<tr>  
	<td colspan=4 bgcolor="#F0F0F0" style="padding:4px" align="right">
	&nbsp;&copy;2005 cyber8 netWorks
	</td>
	</tr> 
</table>
</div> 
<div style="position:absolute;top:0;left:0;display:none" id="colorgrid">
<table cellpadding="0" cellspacing="1" bgcolor="#663399">
	<tr>
		<td><img src='index.php?i=px' width=1 height=1></td><? 
		$kr=0;
		$u = array("00","33","66","99","CC","FF");
		for ($cr=0;$cr<18;$cr++) print "<td><img src='index.php?i=px' width=12 height=1></td>";
		print "</tr><tr><td><img src='index.php?i=px' width=1 height=12></td>";
		for ($cr=0;$cr<count($u);$cr++) {
			for ($cg=0;$cg<count($u);$cg++) {
				for ($cb=0;$cb<count($u);$cb++) {
				   ?> <td bgcolor="#<?=$u[$cb].$u[$cr].$u[$cg]?>" onclick="setcolorGrid ('<?=$u[$cb].$u[$cr].$u[$cg]?>')"></td ><?
				   $kr++;
				   if ($kr%18==0) {
					  print "</tr><tr>";
					  if ($kr<200) print "<td><img src='index.php?i=px' width=1 height=12></td>";
					}
				}
			}
		} ?> 
	</tr>
</table>
</div>
</center>
<script language="javascript">
function showColorGrid () {
	var d=MM_findObj,T=d("colortool"),W=d("colorgrid");
	with (W) {
	   if (style.display=="inline") {
		   style.display = "none";
	   } else {
		   style.display = "inline";
		   style.left = docx(T);
		   style.top  = docy(T)-W.offsetHeight;
	   }
	}
}

function setcolorGrid (i) {
	var d=MM_findObj,T=d("colortool"),W=d("colorgrid"),C=d("ccustom");
	alert (i)
	C.value=i
	T.style.backgroundColor=i
	W.style.display = "none";
}

function docx(e) {    
	var x = 0;
	try {
		for (var i=e;i.tagName!="BODY";i=i.offsetParent) x += i.offsetLeft;
	} catch (ex) { }
	return x;
} 

function docy(e) {    
	var y = 0;
	try {
	for (var i=e;i.tagName!="BODY";i=i.offsetParent) y += i.offsetTop;
	} catch (ex) { }
	return y;
}   

</script>
